<%@ page import="java.util.Date" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %> <%@ page isELIgnored="false" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%
  String path = request.getContextPath();
  String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path + "/";
  String _id=request.getParameter("_");
  request.setAttribute("now",new Date());
%>

<div class="row">
    <div class="col-lg-12">
        <div class="panel">
            <div class="panel-heading">
                <h3 class="panel-title">资产维修登记表</h3>
            </div>

            <!-- BASIC FORM ELEMENTS -->
            <!--===================================================-->
            <form id="form_assetmaintain_input" class="panel-body form-horizontal form-padding">
                <input type="hidden" name="keyId" id="keyId" value="${assetMaintain.id}" />

                <div class="form-group">
                    <label class="col-md-2 control-label">
                        资产名称
                        <i class="fa fa-asterisk txt-color-red"></i>
                    </label>
                    <div class="col-md-6">
                        <input type="text" id="name" name="name" class="form-control" value="${assetMaintain.name}" disabled>
                    </div>
                </div>

                <div class="form-group">
                    <label class="col-md-2 control-label">资产编号<i class="fa fa-asterisk txt-color-red"></i></label>
                    <div class="col-md-6">
                        <input type="text" id="assetNo" name="assetNo" class="form-control" value="${assetMaintain.asset.assetNo}" disabled>
                    </div>
                </div>

                <div class="form-group">
                    <label class="col-md-2 control-label">资产品牌<i class="fa fa-asterisk txt-color-red"></i></label>
                    <div class="col-md-6">
                        <input type="text" id="brand" name="brand" class="form-control" value="${assetMaintain.asset.brand}" disabled>
                    </div>
                </div>

                <div class="form-group">
                    <label class="col-md-2 control-label">规则型号<i class="fa fa-asterisk txt-color-red"></i></label>
                    <div class="col-md-6">
                        <input type="text" id="model" name="model" class="form-control" value="${assetMaintain.asset.model}" disabled>
                    </div>
                </div>

                <div class="form-group">
                    <label class="col-md-2 control-label">
                        维修原因
                        <i class="fa fa-asterisk txt-color-red"></i>
                    </label>
                    <div class="col-md-6">
                        <input type="text" id="maintainReason" name="maintainReason" class="form-control" readonly value="${assetMaintain.maintainReason}">
                    </div>
                </div>

                <div class="form-group">
                    <label class="col-md-2 control-label">
                        维修单位
                        <i class="fa fa-asterisk txt-color-red"></i>
                    </label>
                    <div class="col-md-6">
                        <input type="text" id="maintainUnit" name="maintainUnit" class="form-control" readonly value="${assetMaintain.maintainUnit}">
                    </div>
                </div>

                <div class="form-group">
                    <label class="col-md-2 control-label">
                        维修结果
                        <i class="fa fa-asterisk txt-color-red"></i>
                    </label>
                    <div class="col-md-6">
                        <div class="radio">
                            <input type="radio" name="maintainResult" id="maintainResult1Selected" class="magic-radio" value="0" disabled
                            <c:if test="${assetMaintain.maintainResult eq 0}"> checked="checked"</c:if> >
                            <label for="maintainResult1Selected">维修完成</label>

                            <input type="radio" name="maintainResult" id="maintainResult2Selected" class="magic-radio" value="1" disabled
                            <c:if test="${assetMaintain.maintainResult eq 1}"> checked="checked"</c:if> >
                            <label for="maintainResult2Selected">无法修复</label>
                        </div>
                    </div>
                </div>

                <div class="form-group">
                    <label class="col-md-2 control-label">
                        维修费用（元）
                        <i class="fa fa-asterisk txt-color-red"></i>
                    </label>
                    <div class="col-md-6">
                        <input type="number" id="maintainMoney" name="maintainMoney" class="form-control" readonly value="${assetMaintain.maintainMoney}">
                    </div>
                </div>

                <div class="form-group">
                    <label class="col-md-2 control-label">提交人</label>
                    <div class="col-md-2">
                        <p class="form-control-static">${assetMaintain.creater.name}</p>
                    </div>
                    <label class="col-md-2 control-label">提交日期</label>
                    <div class="col-md-2">
                        <p class="form-control-static"><fmt:formatDate pattern="yyyy-MM-dd" value="${assetMaintain.dateApply}" /></p>
                    </div>
                </div>

            </form>
            <!--===================================================-->
            <!-- END BASIC FORM ELEMENTS -->

            <div class="panel-footer">
                <a class="btn btn-default" id="apply-re-common" href="javascript:void(0)">
                    <i class="fa fa-lg fa-mail-reply"></i> 返回视图
                </a>
                <c:if test="${assetMaintain.numStatus==0}">
                    <a class="btn btn-warning" key="ajax_assetmaintain_edit" href="javascript:void(0);"><i class="fa fa-lg fa-edit"></i> 编辑表单 </a>
                </c:if>
            </div>

        </div>
    </div>
</div>

<script>
    //编辑
    $("a[key='ajax_assetmaintain_edit']").unbind("click").bind("click",function(){
        loadURL("<%=path%>/activiti/assetmaintain/edit/"+$("#keyId").val(),$('#page-content'));
    });

    //返回视图
    $("#apply-re-common").click(returnToHashUrl);

    // 加载完成后执行
    $(function(){
       

    })

</script>
